//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CCanvas.h>
///	@path	~/src/graphics/canvas/
///	@date	2007/11/10
///	@desc	Canvas implementation.

#pragma once

#include "xeres.h"

#include "graphics/DxMath.h"
#include "graphics/ICanvas.h"
#include "graphics/ISprite.h"
#include "graphics/IFont.h"
#include "graphics/ICanvasElement.h"

namespace xeres {

	/*!
		\class	CCanvas
		\brief	Simple Canvas implementation.
	*/
	class CCanvas : public ICanvas
	{
	public:

		/// \ctor
		CCanvas( void );

		/// \dtor
		virtual ~CCanvas( void );

		DECL_IOBJECT_CLASS( CCanvas , ICanvas );

	public:

		/// \impl
		virtual void Initialize( RefWeak<IRenderer> renderer );

		/// \impl
		virtual void Finalize( void );

		/// \impl
		virtual void Render( RenderContext& rc );

		/*!
			\brief		Add element to canvas.
		*/
		void AddElement( RefWeak<ICanvasElement> element );

	private:

		// sprite instance
		Ref< ISprite >						m_sprite;

		std::vector< Ref<ICanvasElement> >	m_elements;

	};

} // namespace xeres
